package com.myframe.www.main;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

import com.myframe.www.R;
import com.yong.android.framework.view.RadioButtonBottomTabFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * A simple {@link Fragment} subclass.
 */
    public class MainBottomFragment extends RadioButtonBottomTabFragment {


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public List<PageInfo> createPages() {
        Fragment shopFragment = new ShopFragment();
        Fragment communityFragment = new CommunityFragment();
        Fragment meFragment = new MeFragment();

        Fragment[] fragments = new Fragment[]{shopFragment, communityFragment, meFragment};
        String[] TITLES = new String[]{"商城", "社区", "个人"};
        final int[] ICONS = new int[]{R.drawable.ic_shop, R.drawable.ic_community, R.drawable.ic_me};


        List<PageInfo> pageList = new ArrayList<>();
        for (int i = 0; i < TITLES.length; i++) {
            pageList.add(new PageInfo(fragments[i], TITLES[i], ICONS[i]));
        }
        return pageList;
    }
}
